﻿using Api.Core.IRepository.Hotel;
using Api.Core.IServices.Hotel;
using Api.Core.Model;
using Api.Core.Model.Hotel;
using System;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace Api.Core.Services.Hotel
{
    public class HotelListService : BaseService<HotelListEntity>, IHotelListService
    {
        public HotelListService(IHotelListRepository _rep)
        {
            base.BaseDal = _rep;
        }

        public async Task<PageModel<HotelListEntity>> GetHotelList(HotelListDto dto)
        {
            Expression<Func<HotelListEntity, bool>> whereExpression = a => a.HotelName.Contains(dto.HotelName);
            var result = await base.QueryPage(
                whereExpression,
                dto.pageIndex,
                dto.pageSize,
                null);
            return result;
        }
    }

}
